load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")
load("@fbsource//xplat/folly:defs.bzl", "folly_xplat_library")
load("@fbsource//xplat/pfh/triage_InfrastructureSupermoduleOptou:DEFS.bzl", "triage_InfrastructureSupermoduleOptou")

oncall("fbcode_entropy_wardens_folly")

# xplat build rules

non_fbcode_target(
    _kind = folly_xplat_library,
    name = "core",
    srcs = [
        "Core.cpp",
    ],
    feature = triage_InfrastructureSupermoduleOptou,
    raw_headers = [
        "Core.h",
    ],
    exported_deps = [
        "fbsource//xplat/folly/synchronization:atomic_util",
        "fbsource//xplat/folly/synchronization:micro_spin_lock",
        ":types",
        "//third-party/fmt:fmt",
        "//third-party/glog:glog",
        "//xplat/folly:executor",
        "//xplat/folly:function",
        "//xplat/folly:optional",
        "//xplat/folly:scope_guard",
        "//xplat/folly:try",
        "//xplat/folly:utility",
        "//xplat/folly/io/async:request_context",
        "//xplat/folly/lang:assume",
        "//xplat/folly/lang:exception",
        "//xplat/folly/lang:switch",
    ],
)

non_fbcode_target(
    _kind = folly_xplat_library,
    name = "types",
    feature = triage_InfrastructureSupermoduleOptou,
    raw_headers = [
        "Types.h",
    ],
)

# fbcode build rules

fbcode_target(
    _kind = cpp_library,
    name = "core",
    srcs = [
        "Core.cpp",
    ],
    headers = [
        "Core.h",
        "Types.h",
    ],
    deps = [
        "fbsource//third-party/fmt:fmt",
    ],
    exported_deps = [
        "//folly:executor",
        "//folly:function",
        "//folly:optional",
        "//folly:scope_guard",
        "//folly:try",
        "//folly:utility",
        "//folly/io/async:request_context",
        "//folly/lang:assume",
        "//folly/lang:exception",
        "//folly/lang:switch",
        "//folly/synchronization:atomic_util",
    ],
    exported_external_deps = [
        "glog",
    ],
)

fbcode_target(
    _kind = cpp_library,
    name = "types",
    headers = ["Types.h"],
)
